import java.util.Objects;

public class User {

    public static void main(String args[]) {
        User u1 = new User("110","police","office");

        User u2 = new User("110","police","office");

        User u3 = new User("110","police1","office");
        if(u1.equals(u2)){
            System.out.println("equal:\t"+u1.toString()+"\t"+u2.toString());
        }
        if(!u1.equals(u3)){
            System.out.println("equal:\t"+u1.toString()+"\t"+u3.toString());
        }
    }

    private String tel;
    private String name;
    private String home;

    public User(String tel, String name, String home) {
        this.tel = new String(tel);
        this.name = new String(name);
        this.home = new String(home);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(tel, user.tel) &&
                Objects.equals(name, user.name) &&
                Objects.equals(home, user.home);
    }

    @Override
    public int hashCode() {

        return Objects.hash(tel, name, home);
    }

    @Override
    public String toString(){
        return this.tel+";"+this.name+";"+this.home;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHome() {
        return home;
    }

    public void setHome(String home) {
        this.home = home;
    }
}
